//封装本地存储模块
export const getItem = name => {
  const data = window.localStorage.getItem(name);
  try {
    return JSON.parse(data);
  } catch (err) {
    return data;
  }
};
//获取
export const setItem = (name, value) => {
  if (typeof value === "object") {
    value = JSON.stringify(value);
  }
  window.localStorage.setItem(name, value);
};
//删除
export const removeItem = name => {
  window.localStorage.removeItem(name);
};

//封装 提示消息
import { Toast } from "vant";
export const tt = str => {
  Toast.success(str);
  // Toast.fail(str);
  // Toast.loading({
  //   message: "加载中...",
  //   forbidClick: true
  // });
};
